package com.l2qq.admin.permission;

import java.util.HashSet;
import java.util.Set;

/**
 * 权限元数据
 */
public class PermissionMeta {
    private final String key;
    private final String name;
    private final String group;
    private final String category;
    private final String controller;
    private final String method;
    private final String remark;
    private final Set<String> dependencies = new HashSet<>();

    public PermissionMeta(String key, String name, String group, String category, 
                         String controller, String method, String remark) {
        this.key = key;
        this.name = name;
        this.group = group;
        this.category = category;
        this.controller = controller;
        this.method = method;
        this.remark = remark;
    }
    
    public void addDependency(String depKey) {
        dependencies.add(depKey);
    }
    
    public Set<String> getDependencies() {
        return new HashSet<>(dependencies);
    }
    
    // Getters
    public String getKey() { return key; }
    public String getName() { return name; }
    public String getGroup() { return group; }
    public String getCategory() { return category; }
    public String getController() { return controller; }
    public String getMethod() { return method; }
    // 新增getter
    public String getRemark() { return remark; }
    @Override
    public String toString() {
        return "PermissionMeta{" +
                "key='" + key + '\'' +
                ", name='" + name + '\'' +
                ", group='" + group + '\'' +
                ", category='" + category + '\'' +
                ", controller='" + controller + '\'' +
                ", method='" + method + '\'' +
                ", remark='" + remark + '\'' +
                ", dependencies=" + dependencies +
                '}';
    }
}